// Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------
// Modification history:
// feature: Code style modification
// ------------------------------------------------------------------

#ifndef INCLUDE_EDDS_DDS_BUILTIN_COMMON_REPLYHEADER_HPP_
#define INCLUDE_EDDS_DDS_BUILTIN_COMMON_REPLYHEADER_HPP_

#include <ertps/rtps/common/SampleIdentity.h>
#include <edds/dds/builtin/common/Types.hpp>

namespace vbsutil {
namespace ecdr {
class Cdr;
}
}  // namespace vbsutil
namespace evbs {

namespace edds {
namespace dds {
namespace rpc {

struct ReplyHeader {
    ertps::rtps::SampleIdentity relatedRequestId;

    RemoteExceptionCode_t remoteEx;

    RTPS_DllAPI static size_t getCdrSerializedSize(const ReplyHeader& data, size_t current_alignment = 0);

    RTPS_DllAPI void serialize(vbsutil::ecdr::Cdr& cdr) const;

    RTPS_DllAPI void deserialize(vbsutil::ecdr::Cdr& cdr);

    RTPS_DllAPI static bool isKeyDefined() { return false; }
};

}  // namespace rpc
}  // namespace dds
}  // namespace edds
}  // namespace evbs

#endif  // INCLUDE_EDDS_DDS_BUILTIN_COMMON_REPLYHEADER_HPP_
